package com.hx.vending.bean.entity;


import com.hx.vending.util.BigDecimalUtils;
import org.apache.commons.lang.StringUtils;

public class Orderdata {
	@Override
	public String toString() {
		return "Orderdata [TransactionMoney=" + TransactionMoney + ", people=" + people + ", Totalnumber=" + Totalnumber
				+ "]";
	}
	/**
	 * 支付总金额
	 */
	private Double TransactionMoney;
	/**
	 *  支付总人数
	 */
	private Integer people;
	/**
	 * 支付总笔数
	 */
	private Integer Totalnumber;
	//人均笔数
	public Double getAveragenumber() {
		if(people==0){
			return 0D;
		}
		return BigDecimalUtils.round(Double.valueOf(Totalnumber),Double.valueOf(people),2);
	}
	/**
	 * 人均金额
	 * @return
	 */
	public Double getAverageAmount() {
		if(people==0){
			return 0D;
		}
		return BigDecimalUtils.round(TransactionMoney,Double.valueOf(people),2);
	}
	public Double getTransactionMoney() {
		return TransactionMoney;
	}
	public void setTransactionMoney(Double transactionMoney) {
		if(StringUtils.isNotBlank(transactionMoney.toString())){
			TransactionMoney = transactionMoney;
		}else{
			TransactionMoney = 0D;
		}
		
	}
	public Integer getPeople() {
		return people;
	}
	public void setPeople(Integer people) {
		this.people = people;
	}
	public Integer getTotalnumber() {
		return Totalnumber;
	}
	public void setTotalnumber(Integer totalnumber) {
		Totalnumber = totalnumber;
	}
}
